package AcWing.每日一题2025;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author ZhuYi
 * @create 2025/3/12 10:36
 */
public class 奶牛体检_6135 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int N = 7501;
        int[] a = new int[N];
        int[] b = new int[N];
        int[] res = new int[N];//存入每种结果的个数
        int cnt = 0;
        String[] arr = br.readLine().split(" ");
        String[] brr = br.readLine().split(" ");
        for (int i = 1; i <= n; i++) {
            //这里a和b0索引的位置要空着，防止后边数组越界
            a[i] = Integer.parseInt(arr[i - 1]);
            b[i] = Integer.parseInt(brr[i - 1]);
            //统计原数组相符的
            if (a[i] == b[i]) {
                cnt++;
            }
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j < 2; j++) {
                int sum = cnt;
                //交换左右（实际不换，只判断），在相应结果（如恰好零头一头二头被体检）加一
                for (int l = i, r = i + j; l >= 1 && r <= n; l--, r++) {
                    if (a[l] == b[l]) sum--;
                    if (a[r] == b[r]) sum--;
                    if (a[l] == b[r]) sum++;
                    if (a[r] == b[l]) sum++;
                    res[sum]++;
                }
            }
        }
        for (int i = 0; i <= n; i++) {
            System.out.println(res[i]);
        }
    }
}
